//
//  CourseSerciveViewController.m
//  TeacherNet
//
//  Created by slz on 2017/12/22.
//  Copyright © 2017年 bnsr. All rights reserved.
//

#import "CourseSerciveViewController.h"

@interface CourseSerciveViewController ()
@property (nonatomic,strong) TTScrollView *scrollView;
@property (nonatomic,strong) NSArray *titles;
@property (nonatomic,strong) NSArray *contents;
@end

@implementation CourseSerciveViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.showNavigationBar = YES;
    [self setControllerTitle:@"承诺服务"];
    UIBarButtonItem * backItem = [UIBarButtonItem itemWithImage:@"back_icon" selectImage:@"" addTarget:self andAction:@selector(backAction)];
    self.navigationItem.leftBarButtonItem = backItem;
    _titles = @[@"24小时作业批改",@"24小时阅卷点评",@"提问必答",@"一对一在线答疑",@"班级活动",@"就业指导"];
    _contents = @[@"24小时内完成作业批改，即时反馈并巩固您的学习效果。",
                  @"24小时内批阅您提交的试卷，给予有针对性的点评。",
                  @"对于提问做到有问必答，帮您扫清学习过程中的种种障碍。",
                  @"不定期组织各种线上或线下的班级活动，让学习更加生动有趣，同学关系更为紧密。",
                  @"提供专属的一对一在线答疑，快速答疑解惑。",
                  @"完成全部学习后，老师对您的学习成果和能力水平给出评估，并提供专业化的就业指导。"];
    
    
    _scrollView = [TTScrollView new];
    _scrollView.contentSize = CGSizeMake(kScreenWidth, 700);
    [self.view addSubview:_scrollView];
    [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.view);
    }];
    UIFont * titleFont = [UIFont boldSystemFontOfSize:kFont_Size_Middle_Title];
    UIFont * contentFont = [UIFont systemFontOfSize:kFont_Size_Cotent_Nomal];
    
    
    
    for (int i = 0;i < _titles.count; i ++) {
        NSString * title = _titles[i];
        UILabel * label = [UILabel new];
        label.textColor = kDark_TextColor_Default;
        label.font = titleFont;
        label.size = CGSizeMake(kScreenWidth, 30);
        label.centerX = self.view.centerX;
        label.top = 20 + i * 110;
        label.text = title;
        label.textAlignment = NSTextAlignmentCenter;
        [_scrollView addSubview:label];
        
        
        UILabel * contentLabel = [UILabel new];
        contentLabel.textColor =kDark_TextColor_Default;
        contentLabel.font = contentFont;
        contentLabel.text = _contents[i];
        contentLabel.numberOfLines = 0;
        contentLabel.size = CGSizeMake(kScreenWidth - 30, 80);
        contentLabel.centerX = self.view.centerX;
        contentLabel.top = label.bottom;
        [_scrollView addSubview:contentLabel];
    }
    
    // Do any additional setup after loading the view.
}

- (void)backAction{
    
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
